<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{% for foo in wzlist %}
    <a href="{{ foo[2] }}" target="_blank">{{ foo[0] }}</a>
    {% if loop.index%10==0 %}
    <br>
    {% endif %}
{% endfor %}
<hr>

{% for f in b %}
    <h1>{{ f }}</h1>
    {% for foo in wzlist %}

        {% if f==foo[1] %}

            <a href="{{ foo[2] }}" target="_blank">{{ foo[0] }}</a>

        {% endif %}
    {% endfor %}
{% endfor %}

</body>
</html>